﻿/* mvcForum
 * Copyright (C) 2010-2011 Steen F. Tøttrup
 * http://mvcforum.org/
 */

using System;
using System.ComponentModel.DataAnnotations;

namespace mvcForum.Core {

	/// <summary>
	/// This class represent the combination of a group, forum and access mask.
	/// </summary>
	public class ForumAccess {
		public ForumAccess() { }
		public ForumAccess(Forum forum, Group group, AccessMask mask) {
			this.Forum = forum;
			this.Group = group;
			this.AccessMask = mask;
		}

		#region Properties
		/// <summary>
		/// The Id of the forum access.
		/// </summary>
		public Int32 Id { get; internal set; }
		/// <summary>
		/// The forum this forum access belongs to.
		/// </summary>
		[Required]
		public Int32 ForumId { get; set; }
		public virtual Forum Forum { get; set; }
		/// <summary>
		/// The group this forum access belongs to.
		/// </summary>
		[Required]
		public Int32 GroupId { get; set; }
		public virtual Group Group { get; set; }
		/// <summary>
		/// The access mask this forum access belongs to.
		/// </summary>
		[Required]
		public Int32 AccessMaskId { get; set; }
		public virtual AccessMask AccessMask { get; set; }
		#endregion
	}
}